<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
 */
Route::group(['middleware' => [], 'prefix' => 'attachment'], function () {
	Route::any('upload', 'AttachmentController@upload'); //文件上传
});

//用户登录/注册 单独存放，用户接口组均要判断是否登录，除了注册登录
Route::post("login", "LoginController@login");

/*免登录接口组*/
Route::group([
    'middleware' => [],
    'prefix' => 'index',
], function () {
    Route::any("get_rotation","IndexController@get_rotation");
    Route::any("get_school","IndexController@get_school");
    Route::post("get_school_name","IndexController@get_school_name");
    Route::post("get_school_building","IndexController@get_school_building");
    Route::post("get_weight","IndexController@get_weight");
    Route::post("get_distribution","IndexController@get_distribution");
    Route::post("get_cargo","IndexController@get_cargo");
    Route::any("get_address","IndexController@get_address");
    Route::any("get_agreement","IndexController@get_agreement");
    Route::post("get_time","IndexController@get_time");
    Route::post("school_express","IndexController@school_express");
    Route::post("get_list","IndexController@get_list");
    Route::any("get_express","IndexController@get_express");
    Route::any("order_ratio","IndexController@order_ratio");
    Route::any("get_config","IndexController@get_config");
    Route::any("get_img","IndexController@get_img");


});



/*用户地址*/
Route::group([
    'middleware' => ['auth.api'],
    'prefix' => 'userctty',
], function () {
    Route::post("addUser","UserCttyController@addUser");
    Route::post("editUser","UserCttyController@editUser");
    Route::post("delUser","UserCttyController@delUser");
    Route::post("data_list","UserCttyController@data_list");
    Route::post("userDetails","UserCttyController@userDetails");


    Route::post("address_list","UserCttyController@address_list");

    Route::post("deladdress","UserCttyController@deladdress");
    Route::post("addaddress","UserCttyController@addaddress");
    Route::post("editaddress","UserCttyController@editaddress");
    Route::post("detailsaddress","UserCttyController@detailsaddress");


});


/*用户订单*/
Route::group([
    'middleware' => ['auth.api'],
    'prefix' => 'order',
], function () {
    Route::post("index","OrderController@index");
    Route::post("addOrder","OrderController@addOrder");
    Route::post("orderlist","OrderController@orderlist");
    Route::post("order_details","OrderController@order_details");
    Route::post("che_code","OrderController@che_code");
    Route::post("cancel_order","OrderController@cancel_order");
    //订单评价
    Route::post("order_comments","OrderController@order_comments");

    //订单价格计算
    Route::post("order_ore","OrderController@order_ore");
    Route::any("order_count","OrderController@order_count");


});
/*配送员订单*/
Route::group([
    'middleware' => ['auth.api'],
    'prefix' => 'distributionorder',
], function () {
    Route::post("order_list","DistributionOrderController@order_list");
    //订单详情
    Route::post("order_details","DistributionOrderController@order_details");
    //抢单
    Route::post("order_grabbing","DistributionOrderController@order_grabbing");
    //取消订单
    Route::post("cancel_order","DistributionOrderController@cancel_order");
    //代取确认
    Route::post("take_order","DistributionOrderController@take_order");
    //待寄取货
    Route::post("send_take_order","DistributionOrderController@send_take_order");
    //待寄确认
    Route::post("send_order","DistributionOrderController@send_order");
    Route::post("order_user_list","DistributionOrderController@order_user_list");
    Route::post("order_user_details","DistributionOrderController@order_user_details");
    Route::post("get_cancel","DistributionOrderController@get_cancel");
    Route::any("order_count","DistributionOrderController@order_count");
});


/*用户接口组*/
Route::group([
    'middleware' => 'auth.api',
    'prefix' => 'user',
], function () {
    //更新用户信息
    Route::post("updateUser","UserController@updateUser");
    //根据id获取用户信息
    Route::post("getUserInfo","UserController@getUserInfo");
    //配送员消费明细
    Route::any("distribution_info","UserController@distribution_info");
    //配送员申请提现
    Route::post("user_withdrawal","UserController@user_withdrawal");
    //用户投诉建议
    Route::post("user_complaint","UserController@user_complaint");
    Route::post("updatedistribution","UserController@updatedistribution");

});

//杂项接口
Route::group([
    'middleware' => [],
    'prefix' => 'util',
],function(){
    //微信支付回调
    Route::post("WxPayNotify","UtilController@WxPayNotify");
});

//计划任务接口
Route::group([
    'middleware' => [],
    'prefix' => 'tasks',
],function(){
    //微信支付回调
    Route::any("tasks","TasksControllers@tasks");
    Route::any("num_order","TasksControllers@num_order");

});

//Route::group(['middleware' => [], 'prefix' => 'demo'], function () {
//	Route::any('sms', 'DemoController@sms'); //发送短信
//	Route::any('upload', 'DemoController@upload'); //图片上传(七牛云)
//	Route::any('wxpay', 'DemoController@wxpay'); //微信小程序支付
//	Route::any('wxpay_mp', 'DemoController@wxpay_mp'); //微信H5支付
//	Route::any('alipay', 'DemoController@alipay'); //支付宝H5支付
//	Route::any('official_oauth', 'DemoController@official_oauth'); //微信公众号授权
//	Route::any('oauth_back', 'DemoController@oauth_back'); //微信公众号授权后调
//	Route::any('validator', 'DemoController@validator'); //微信公众号授权后调
//
//	Route::any('access_token', 'DemoController@access_token'); //微信公众号access_token
//	Route::any('official_push', 'DemoController@official_push'); //微信公众号模板消息推送
//
//	Route::any('miniapp_oauth', 'DemoController@miniapp_oauth'); //微信小程序获取openid
//	Route::any('miniapp_code', 'DemoController@miniapp_code'); //微信小程序二维码 A方案
//});

// Route::group([], function(){
//     Route::any('login','AuthController@login');
//     Route::any('register', 'AuthController@register');
// });

// Route::group(['middleware' => ['auth.api'],'prefix'=>'User'], function(){
//     Route::any('index', 'UserController@index');
//     Route::any('getProvince', 'UserController@getProvince');
// });
// //-- 通知类路由分组
// Route::group(['middleware' => ['auth.api'],'prefix'=>'Invoice'], function(){
//     Route::any('createDateBase', 'InvoiceController@createDateBase');
//     Route::any('getUnread', 'InvoiceController@getUnread');
//     Route::any('setRead', 'InvoiceController@setRead');
//     Route::any('delRead', 'InvoiceController@delRead');
//     Route::any('setRedis', 'InvoiceController@setRedis');
//     Route::any('createOrder', 'InvoiceController@createOrder');
// });

// //-- 队列类路由分组
// Route::group(['middleware' => ['auth.api'],'prefix'=>'Queue'], function(){
//     Route::any('createOrder', 'QueueController@createOrder');
// });
// Route::any('getBanner',"IndexController@getBanner");
// Route::group(['middleware'=>[],'prefix'=>'Index'],function (){
//     Route::any('getBanner',"IndexController@getBanner");
//     Route::any('newMarket',"IndexController@newMarket");
// });
// //-- 文件和图片路由组
// Route::group(['middleware'=>[],'prefix'=>'Upload'],function (){
//     Route::any('createFolder', 'UploadController@createFolder');
//     Route::any('deleteFolder', 'UploadController@deleteFolder');
//     Route::any('fileList', 'UploadController@fileList');
//     Route::any('deleteFile', 'UploadController@deleteFile');
//     Route::any('uploadFile', 'UploadController@uploadFile');
//     Route::any('uploadBase64', 'UploadController@uploadBase64');
//     Route::any('uploadImg', 'UploadController@uploadImg');
//     Route::any('getCode', 'UploadController@getCode');
// });
